package com.study.leetcode;

public class Solution_171 {
    public int titleToNumber(String s) {
        int col = 0;
        int len = s.length();
        for (int i = 0; i < len; i++) {
            int temp = s.charAt(i) - 'A' + 1;
            col = col * 26 + temp;
        }
        return col;
    }

    public static void main(String[] args) {
        Solution_171 solution171 = new Solution_171();
        int toNumber = solution171.titleToNumber("US");
        System.out.println("toNumber = " + toNumber);

    }
}
